import request from "../utils/request.js"

// 配置请求基本URL
const api = request

// 登录接口
export const login = (empName,password) => api.post('api/emp/login', {
    empName,
    password,
    admin :1});

// 书籍相关接口
export const getBooks = () => api.get('api/book/list');
export const addBook = (data) => api.post('api/book/add', data);
export const deleteBook = (id) => api.delete(`api/book/del/${id}`);
export const updateBook = (data) => api.post('api/book/update', data);

// 问题相关接口
export const getProblems = (params) => api.post('api/problem/page', params);
export const addProblem = (data) => api.post('api/problem', data);
export const updateProblem = (data) => api.put('api/problem/update', data);
export const deleteProblem = (id) => api.delete(`api/problem/del/${id}`);
